package domain;

public class Document {
	private Integer id;
	private String name;
	private String path;
	private Integer numberOfWords;
	private Long fileSize;
	private Integer totalOfDocuments;

	// Atributos utilizados para la ponderacion de la busqueda
	private transient Integer ck;
	private transient Double weigth;
	private Post post;

	public Document() {
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public Integer getNumberOfWords() {
		return numberOfWords;
	}

	public void setNumberOfWords(Integer numberOfWords) {
		this.numberOfWords = numberOfWords;
	}

	public Integer getTotalOfDocuments() {
		return totalOfDocuments;
	}

	public void setTotalOfDocuments(Integer totalOfDocuments) {
		this.totalOfDocuments = totalOfDocuments;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * Acceso a fileSize
	 * @return valor del atributo fileSize
	 */
	public Long getFileSize() {
		return fileSize;
	}

	/**
	 * Modificador de fileSize
	 * @param fileSize nuevo valor del atributo fileSize
	 */
	public void setFileSize(Long fileSize) {
		this.fileSize = fileSize;
	}

	/**
	 * Acceso a ck
	 * @return valor del atributo ck
	 */
	public Integer getCk() {
		return ck;
	}

	/**
	 * Modificador de ck
	 * @param ck nuevo valor del atributo ck
	 */
	public void setCk(Integer ck) {
		this.ck = ck;
	}

	/**
	 * Acceso a weigth
	 * @return valor del atributo weigth
	 */
	public Double getWeigth() {
		return weigth;
	}

	/**
	 * Modificador de weigth
	 * @param weigth nuevo valor del atributo weigth
	 */
	public void setWeigth(Double weigth) {
		this.weigth = weigth;
	}

	/**
	 * Acceso a post
	 * @return valor del atributo post
	 */
	public Post getPost() {
		return post;
	}

	/**
	 * Modificador de post
	 * @param post nuevo valor del atributo post
	 */
	public void setPost(Post post) {
		this.post = post;
	}

	public boolean equals(Object o) {
		Document d = (Document) o;
		return (d.path.concat(d.name)).equalsIgnoreCase(this.path.concat(this.name));
	}
}
